Organize has different move behavior when using wildcard
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
This copies the _contents_ of `ClimateTrail-1.3-pc` to the root of the install folder.
organize:
'ClimateTrail-1.3-pc/' : './'
This copies the directory `ClimateTrail-1.3-pc` _itself_ to the root of the install folder (and thus gives the error "ClimateTrail-1.3-pc already exists")
organize:
'ClimateTrail-*-pc/' : './'
This happens because non-globbed directories are moved using `file_utils.link_or_copy_tree`, which copies _contents_
https://github.com/snapcore/snapcraft/blob/ae7ab338e4c5d49edb88b8ff78da6e98dc12881a/snapcraft/internal/pluginhandler/__init__.py#L1146
While globbed directories are moved using `shutil.move(src, dst)` which moves the directory _itself_
https://github.com/snapcore/snapcraft/blob/ae7ab338e4c5d49edb88b8ff78da6e98dc12881a/snapcraft/internal/pluginhandler/__init__.py#L1179
This inconsistency is quite confusing and made me lose a lot of time. I suspect changing this behavior will break a lot of existing snapcraft.yaml files, so that's not really an option. However, I'm completely lost as to how I should move the contents of `ClimateTrail-1.3-pc` to the root without specifying the version number.
If I try
organize:
'ClimateTrail-*-pc/*' : './'
I get the error `Destination path '/root/parts/climate-trail/install/./ClimateTrail.sh' already exists` and I have no idea why..
For reference, these are the contents of the directories:
snapcraft-climate-trail # ls parts/climate-trail/build/
ClimateTrail-1.3a-pc
snapcraft-climate-trail # ls parts/climate-trail/build/ClimateTrail-1.3a-pc/
ClimateTrail.py ClimateTrail.sh game lib renpy
snapcraft-climate-trail # ls parts/climate-trail/install/
ClimateTrail-1.3a-pc ClimateTrail.sh etc lib usr
Evaluation history
No evaluation history available.